package com.cskaoyan.mapper;

import com.cskaoyan.bean.Admin;
import com.cskaoyan.bean.AdminExample;
import com.cskaoyan.bean.AdminInfoBean;
import com.cskaoyan.bean.AdminUpdateBO;
import com.cskaoyan.bean.params.AdminListBO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface AdminMapper {
    long countByExample(AdminExample example);

    int deleteByExample(AdminExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Admin record);

    int insertSelective(Admin record);

    List<Admin> selectByExample(AdminExample example);

    Admin selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Admin record, @Param("example") AdminExample example);

    int updateByExample(@Param("record") Admin record, @Param("example") AdminExample example);

    int updateByPrimaryKeySelective(Admin record);

    int updateByPrimaryKey(Admin record);

    List<AdminListBO> select(@Param("sort") String sort, @Param("order") String order, @Param("username") String username);

    int insertSelectiveUsingGeneralKey(Admin admin);

    int selectIdByNameAndPassword(@Param("username") String username, @Param("password") String password);

    Integer[] getRolesByUserId(Integer userId);

    AdminInfoBean queryAdminInfoById(Integer userId);

    String queryUsernameById(Integer userId);

    void updateIpByUserId(@Param("userId") Integer userId, @Param("ip") String ip);
}